﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using DTO;
using DAO;

namespace BUS
{
    public class ChuyenBay_BUS
    {
        public static BindingList<ChuyenBay_DTO> GetChuyenBayList()
        {
            BindingList<ChuyenBay_DTO> listChuyenBay = new BindingList<ChuyenBay_DTO>();
            try
            {
                ChuyenBay_DAO chuyenbayDAO = new ChuyenBay_DAO();
                listChuyenBay = chuyenbayDAO.GetChuyenBayList();
            }
            catch (System.Exception)
            {

            }
            return listChuyenBay;
        }

        public static ChuyenBay_DTO GetChuyenBayDetails(string maChuyenBay)
        {
            ChuyenBay_DTO chuyenbayDTO = new ChuyenBay_DTO();
            try
            {
                ChuyenBay_DAO chuyenbayDAO = new ChuyenBay_DAO();
                chuyenbayDTO = chuyenbayDAO.GetChuyenBayDetails(maChuyenBay);
            }
            catch (System.Exception)
            {
            }
            return chuyenbayDTO;
        }

        public static  string MaxMaChuyenBay()
        {
            return ChuyenBay_DAO.MaChuyenBayMax();
        }

        public static void InsertChuyenBay(ChuyenBay_DTO chuyenbayDTO)
        {
            try
            {
                ChuyenBay_DAO chuyenbayDAO = new ChuyenBay_DAO();
                chuyenbayDAO.InsertChuyenBay(chuyenbayDTO);
            }
            catch
            { }
        }

        public static void UpdateChuyenBay(ChuyenBay_DTO chuyenbayDTO)
        {
            try
            {
                ChuyenBay_DAO chuyenbayDAO = new ChuyenBay_DAO();
                chuyenbayDAO.UpdateChuyenBay(chuyenbayDTO);
            }
            catch
            { }
        }

        public static void DeleteChuyenBay(ChuyenBay_DTO chuyenbayDTO)
        {
            try
            {
                ChuyenBay_DAO chuyenbayDAO = new ChuyenBay_DAO();
                chuyenbayDAO.DeleteChuyenBay(chuyenbayDTO);
            }
            catch
            { }
        }
    }
}
